package com.study.observermode.springObserver;

import com.study.observermode.springSubject.MySubject;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName: MyObserverB
 * @Description: spring中观察者角色
 * @Details: 需要实现ApplicationListener接口
 * @Author: 郑港旭
 * @Create: 2021-11-16 16:56
 **/
@Component
public class MyObserverB implements ApplicationListener<MySubject> {
    @Override
    public void onApplicationEvent(MySubject event) {
        System.out.println("observerB received");
    }
}
